package com.owner.lt.tool;

import com.owner.lt.tool.entity.ReportUnit;
import com.owner.lt.tool.tool.ExecInsertTool;
import com.owner.lt.tool.tool.ExecQueryTool;
import com.owner.lt.tool.utils.JDBCUtils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class AppTest {

    public static void main(String[] args) throws SQLException {
        Connection connection = JDBCUtils.getConnection();
        ExecInsertTool execInsertTool = new ExecInsertTool(connection);
        ExecQueryTool execQueryTool = new ExecQueryTool(connection);
        String sql = "select SID,CODE_,leaf,PARENT_ID,parents_,text,level_,bankLevel from jer_reportunit where SID=?;";
        List<ReportUnit> reportUnits = execQueryTool.executeQuery(sql, ReportUnit.class, "00102002");
        System.out.println(reportUnits);

    }

}
